package com.arpa.oms.service;

import com.arpa.oms.domain.dto.OmsSupplierDTO;
import com.arpa.oms.domain.dto.OmsSupplierFormDTO;
import com.arpa.oms.domain.entity.OmsSupplier;
import com.arpa.oms.domain.vo.OmsSupplierVO;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 供应商 服务类
 * </p>
 *
 * @author wangdong
 * @since 2021-07-21
 */
public interface IOmsSupplierService extends IService<OmsSupplier> {


    /**
     * 保存
     * @param entity
     * @return
     */
    boolean save(OmsSupplierFormDTO entity);

    /**
     * 根据code更新实体
     * @param entity
     * @return
     */
    int updateByCode(OmsSupplierFormDTO entity);

    /**
     * 查询列表
     * @param supplierDTO
     * @return
     */
    List<OmsSupplierVO> queryList(OmsSupplierDTO supplierDTO);
     /**
      *  @author: Allen chen
      *  @Date: 2020/9/8 14:39
      *  @Description: 根据供应商名称和编号查询
      */
    List<OmsSupplierVO> queryByNameOrCode(OmsSupplierDTO supplierDTO);

    /**
     * 查询合计,包含总数
     * @param supplierDTO
     * @return
     */
    OmsSupplierVO queryListSum(OmsSupplierDTO supplierDTO);

    /**
     *  @author: Allen chen
     *  @Date: 2020/9/5 14:30
     *  @Description: 批量删除
     */
    int batchDelete(List<String> codes,String modifiedBy);

    /**
     * 模糊查询供应商
     * @param keywords 关键字
     * @return
     */
    List<Map<String, Object>> search(String keywords);

    /**
     * 通过code查询供应商信息
     * 使用缓存查询
     * @param code
     * @return
     */
    OmsSupplierVO getOneInfo(String code);
}
